﻿using NetMicro.Core.Extensions;
using NetMicro.EventBus;
using NetMicro.EventBus.Attributes;

namespace Sample.Eventbus
{
    [EventHandler("testqueue")]
    public class TestEventHandler : IEventHandler<TestEvent>
    {
        private readonly ILogger<TestEventHandler> _logger;
        public TestEventHandler(ILogger<TestEventHandler> logger)
        {
            _logger = logger;
        }
        public Task Execute(TestEvent @event, IDictionary<string, string> additionalItems)
        {
            _logger.LogInformation(@event.ToJson());
            return Task.CompletedTask;
        }
    }
}
